package com.lgl.controller;

import com.lgl.dto.UpdatePwdDTO;
import com.lgl.entity.ResponseResult;
import com.lgl.entity.User;
import com.lgl.service.UserService;
import com.lgl.vo.UserInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/userInfo")
    public ResponseResult getUserInfo(){
        return userService.getUserInfo();
    }
    @PutMapping("/userInfo")
    public ResponseResult updateUserInfo(@RequestBody User user){
        return userService.updateUserInfo(user);
    }
    @PostMapping("/register")
    public ResponseResult register(@RequestBody User user){
       return userService.register(user);
    }
    @PutMapping("/updatepassword")
    public ResponseResult updatepassword(@RequestBody UpdatePwdDTO updatePwdDTO){
        return userService.updatepassword(updatePwdDTO);
    }
}
